<!--资源情况-->
<template>
  <div class="Resources">
    <DicTable
        height="100%"
        stripe
        highlight-current-row
        highlight-hover-row
        max-height="600"
        ref="GBLtable"
        border
        header-row-class-name="header-row-class"
        row-class-name="ne-row-class"
        :columnData="GBLtbs.tableColumns"
        :tableData="GBLtbs.tableData"
        :loading="GBLtbs.tableLoading"
        :currentPage="~~GBLtbs.tablePage.pageIndex"
        :pageSize="~~GBLtbs.tablePage.pageSize"
        :totalResult="~~GBLtbs.tablePage.rowCount"
        :pager="true"
        @on-page-change="handlePageChange"
    >
    </DicTable>
  </div>
</template>
<script>
import DicTable from "@/components/public/DicTable";
import CustOrderService from "@/api/order/CustOrderService";
import { mapState } from "vuex";
export default {
  name: "Resources",
  data() {
    return {
      GBLtbs: {
        tableColumns: [
          { field: "custSoNumber", title: "流水号",width: '8%'},
          { field: "prodName", title: "产品名称"},
          { field: "areaName", title: "装机地址"},
          { field: "disAreaName", title: "通达地址"},
          { field: "orgName", title: "端局",width: '10%'},
          { field: "circuitCode", title: "电路代号/业务号码",width: '8%'},
          { field: "resultInfo", title: "资源情况"},
          { field: "planTime", title: "预期工期"},
          { field: "taskReqDate", title: "资源要求反馈日期",width: '8%'},
          { field: "taskOprDate", title: "资源反馈日期",width: '8%'},
          { field: "userName", title: "资源反馈人"},
          { field: "linkTel", title: "资源人联系电话",width: '10%'},
          { field: "taskComment", title: "说明"}
        ],
        tableData:  [],
        tableLoading: false,
        tablePage: {
          pageIndex: 1,
          pageSize: 10,
          rowCount: 0,
        },
      }
    }
  },
  props: {
    // ODKInfo: {
    //   type: Object
    // },
    CTOInfo: {
      type: Object
    }
  },
  mounted() {

  },
  created() {
	this.getList();
  },
  components: {DicTable},
  computed: {
  	...mapState("user", ["user"]),
  },
  methods: {
	async getList(){
	  let{custOrderId,custSoNumber,custId,handleOrgId} = this.CTOInfo,
	      pageInfo={
	        pageIndex: ~~this.GBLtbs.tablePage.pageIndex+'',
	        pageSize: ~~this.GBLtbs.tablePage.pageSize+''
	      },
	      params = {custOrderId,custSoNumber,custId,handleOrgId,orgId:this.user.orgId,pageInfo:pageInfo};
	  const result = await CustOrderService.qryResourceVerification(params);
	  if(result.meta.resultCode=='0' || !result.meta.resultCode){
	    this.GBLtbs.tableData = result.meta.orderResourceVerifications;
	    this.GBLtbs.tablePage = {
	          pageIndex: ~~Number(result.meta.pageInfo.pageIndex),
	          pageSize: ~~Number(result.meta.pageInfo.pageSize),
	          rowCount: ~~Number(result.meta.pageInfo.rowCount)
	    };
	  }else{
	    this.$message({
	      showClose: true,
	      message: result.meta.resultMsg,
	      type: 'error'
	    });
	  };
	},
	  
    handlePageChange({ currentPage, pageSize }) {
      this.GBLtbs.tablePage.pageIndex = currentPage;
      this.GBLtbs.tablePage.pageSize = pageSize;
	  this.getList();
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
